The following contains notes and tips for creating an Interview Service client in .NET.
To add and remove Web References (2.0 Framework), refer to the information found at the following link:
http://msdn.microsoft.com/en-us/library/d9w023sx(v=VS.90).aspx
The sample client's target framework is 2.0.
To add and remove Service References (3.0 Framework and later), refer to the following tutorial in this Oracle Policy Automation Developer's Guide:
Tutorial: Create and use a C# client for Oracle Determinations Server.
For a description of the available operations, refer to the topic Interview Service.
When creating an interview session, the default rulebase language is used if no language information is specified in the soap header. To insert an element in the SoapHeader, one can achieve this using:
Of the three, the simplest approach is to create a class that extends SoapHeader (option b). Note that the determinations-server is expecting a <locale> element, so the root element name should be specified accordingly; otherwise, the class name will be used as the element name during serialization. In this case, the element will be ignored and the default rulebase language is used.
[System.Xml.Serialization.XmlRoot("international", Namespace = "http://www.w3.org/2005/09/ws-i18n")]
public class ODSSoapHeader : SoapHeader
{
public String locale;
public String tz;
}
Modify the proxy code to add ODSSoapHeader as a public member.
public partial class odsInterviewService_InterviewServiceTest : System.Web.Services.Protocols.SoapHttpClientProtocol {
public ODSSoapHeader customHeader;
Apply a SoapHeader attribute on the relevant client method. In this case, OpenSession().
[System.Web.Services.Protocols.SoapHeader("customHeader")]
public opensessionresponse OpenSession([System.Xml.Serialization.XmlElementAttribute("open-session-request",
Namespace="http://oracle.com/determinations/server/interview/InterviewServiceTest/types")] opensessionrequest opensessionrequest) {
object[] results = this.Invoke("OpenSession", new object[] {
opensessionrequest});
return ((opensessionresponse)(results[0]));
}
We now specify the locale prior to invoking OpenSession operation.
opensessionrequest request = new opensessionrequest();
odsInterviewService_InterviewServiceTest proxy = new odsInterviewService_InterviewServiceTest();
if (locale != null)
{
ODSSoapHeader mainHeader = new ODSSoapHeader();
mainHeader.locale = locale;
proxy.customHeader = mainHeader;
}
opensessionresponse response = proxy.OpenSession(request);
These operations require a data adaptor plugin. No default adaptor is provided in Oracle Determinations Server. A generic error will be returned when no data adaptor is deployed.
Investigate, Get and Set Screen operations process screen data. When sending screen data, keep in mind the following:
The project and related files are located in: Oracle_Policy_Automation_Runtime_DotNet_10_3_0\examples\interview-service-client. The project, a simple version of Web Determinations, was created to test the Interview Service operations. Some features (such as handling of input styles and custom properties) are not present.
To be able to run the project, it is assumed that:
The model classes are located in the ODSClient project. This is also where the Web References are defined. The sample web application can detect other rulebases deployed in ODS, but an error is thrown when attempting to create a session. To be able to handle additional rulebases, the following steps are necessary:
Click here to view the solution explorer.
![]()
The information displayed on the Home Page screen is the output of List Rulebases and Get Server Info (for the runtime versions displayed in the footer), both are Server Service operations.
As of release 10.2, the List Rulebases operation includes the available locales in a rulebase locale. Once the locale link is clicked, an interview session is started by calling Open Session operation. At that point, a session id will be generated.
Click here to view the Home Page screen
![]()
If there is only one goal for the rulebase, it is possible to launch an investigation right away. For those multiple goals, a displaying a summary screen is advisable. To do this, we can:
Click here to view the Summary screen
![]()
The client application simply renders the screen data included in the Determinations Server response. When form data is submitted, the screen data (with or without input value) is set in the request. If at least one of the screen controls is not declared in the request, an error is thrown. Invisible controls should also be included.
If there are errors, the response will return the current screen. Otherwise, the next screen is returned. If the goal is already known, the screen returned will be the summary screen.
Question Screen
Click here to view the Question screen
![]()
Entity Collect Screen
If the screen is an Entity Collect screen, the first entity instance control can serve as a template. As with Web Determinations, the client will generate the entity instance id.
Click here to view the Entity Collect screen
![]()
The Get User Set Data page displays the current session data (Get User Set Data operation).
Click here to view the Get User Set Data page
![]()
The List Screens page displays the screen instances in scope. This based on List Screens operation.
Click here to view the List Screens page
![]()
The Load Case page initially lists the available cases (List Cases operation). If Load Case is successful, the page is redirected to the summary screen. This requires a data adaptor plugin.
Click here to view the Load Case page
![]()
The Save Case page enables the user to save the session data. This requires a data adaptor plugin.
Click here to view the Save Case page
![]()